package cn.cycleif.app.controller;

import cn.cycleif.app.domain.dto.VoteDTO;
import cn.cycleif.app.service.VoteService;
import cn.cycleif.util.R;
import cn.dev33.satoken.annotation.SaCheckLogin;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Date: 25/2/13-12:58
 * @Desc:
 */
@RequestMapping("/api/vote")
@Tag(name = "投票", description = "投票接口")
@RestController
@SaCheckLogin
public class VoteController {

  @Autowired
  private VoteService voteService;

  @PostMapping
  public R<String> addVote(@RequestBody VoteDTO dto) {
    return voteService.addVote(dto);
  }
}
